import bus from '@/bus'
import {
  renderButton
} from '@/util'
let data = {
  status: 'pass',
  totalItem: 1,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    beginYearmonth: '',
    endYearmonth: ''
  },
  model10: [],
  columns: [{
      title: ' ',
      key: 'name',
      align: 'left',
      minWidth: 200,
      children: [{
        title: '科室',
        key: 'officeName',
        align: 'left',
        minWidth: 200,
      }, ]
    },
    {
      title: ' ',
      key: 'name',
      align: 'left',
      minWidth: 200,
      children: [{
        title: '地区',
        key: 'depName',
        align: 'left',
        minWidth: 200,
      }, ]
    },
    {
      title: ' ',
      key: 'name',
      align: 'left',
      minWidth: 300,
      children: [{
        title: '经销商',
        key: 'distributorName',
        align: 'left',
        minWidth: 300,
      }, ]
    },
    {
      title: ' ',
      key: 'name',
      align: 'left',
      minWidth: 100,
      children: [{
        title: '月份',
        key: 'yearmonth',
        align: 'left',
        minWidth: 100,
      }, ]
    },

    {
      title: 'APP门店抢购门店数',
      align: 'right',
      children: [{
          title: 'APP抢购目标门店数',
          key: 'storeNumTarget',
          align: 'right',
          minWidth: 200,
        },
        {
          title: 'APP抢购基础门店数',
          key: 'storeNumBase',
          align: 'right',
          minWidth: 200,
        },
        {
          title: '实际APP抢购门店数',
          key: 'storeNum',
          align: 'right',
          minWidth: 200,
        },


      ]
    },
    {
      title: 'APP抢购门店增长数(x2)',
      align: 'right',
      children: [{
          title: '增长数',
          key: 'storeNumIncrease',
          align: 'right',
          width: 200
        },
        {
          title: '排名',
          key: 'storeNumIncreaseRank',
          align: 'right',
          width: 200
        },
        {
          title: '得分',
          key: 'storeNumIncreaseScore',
          align: 'right',
          width: 200
        }
      ]
    },
    {
      title: 'APP抢购门店完成率(x2)',
      align: 'left',
      children: [{
          title: '完成率',
          key: 'storeNumCompleteRate',
          align: 'right',
          width: 200
        },
        {
          title: '排名',
          key: 'storeNumCompleteRateRank',
          align: 'right',
          width: 200
        },
        {
          title: '得分',
          key: 'storeNumCompleteRateScore',
          align: 'right',
          width: 200
        }
      ]
    },
    {
      title: '轮胎保门店参与率(x1)',
      align: 'right',
      children: [{
          title: '参与率',
          key: 'storeNumProtectionRate',
          align: 'right',
          width: 200
        },
        {
          title: '排名',
          key: 'storeNumProtectionRateRank',
          align: 'right',
          width: 200
        },
        {
          title: '得分',
          key: 'storeNumProtectionRateScore',
          align: 'right',
          width: 200
        }
      ]
    },
    {
      title: 'APP门店抢购条数',
      align: 'right',
      children: [{
          title: 'APP目标抢购条数',
          key: 'purchNumTarget',
          align: 'right',
          width: 200
        },
        {
          title: '实际APP抢购条数',
          key: 'purchNum',
          align: 'right',
          width: 200
        },

      ]
    },
    {
      title: 'APP抢购轮胎条数完成率(x1)',
      align: 'right',
      children: [{
          title: '增长率',
          key: 'purchNumCompleteRate',
          align: 'right',
          width: 200
        },
        {
          title: '排名',
          key: 'purchNumCompleteRateRank',
          align: 'right',
          width: 200
        },
        {
          title: '得分',
          key: 'purchNumCompleteRateScore',
          align: 'right',
          width: 200
        }
      ]
    },
    {
      title: '总得分',
      key: 'totalScore',
      align: 'right',
      minWidth: 200,
    },
    {
      title: ' 总排名',
      key: 'totalRank',
      align: 'right',
      minWidth: 200,

    },

    {
      title: '操作',
      key: 'gender',
      align: 'right',
      minWidth: 100,
      fixed: 'right',
      render: (h, params) => {
        let now = new Date()
        let month = (now.getMonth() + 1)
        let curmonthstr = month >= 10 ? month : 0 + '' + month
        let curm = parseInt(now.getFullYear() + '' + curmonthstr)
        let rowm = parseInt(params.row.yearmonth)
        return h('div', [
            h('Button', {
                props: {  
                    type: 'primary',
                    size: 'small',
                    disabled: curm > rowm ? true : false
                },
                on: {
                    click: () => {
                        bus.$emit('onEdit',params.row)
                    }
                }
            }, '编辑'),
        ]);
    },
}
    
  ],
  data: []
}
export default data
